function myMap(arr, mapCallback) {
    if(!Array.isArray(arr) || !arr.length || typeof mapCallback != 'function') {
        return [];
    } else {
        let result = [];
        for (let i = 0; i < arr.length; i++){
            result.push(mapCallback(arr[i],i,arr));
        }
        return result;
    }
};

const arr = [1,3,2,5];
console.log(myMap(arr,(item)=> item = item + 1))

